<template>
  <div class="user_balance">
    <div class="user_balance_item">
      <!-- 显示余额 -->
      <div class="user_balance_item_number">
        <div class="item_number_title">我的可用余额</div>
        <div class="item_number_num">
          <span class="item_number_num_m">{{ banalce.number[0] }}</span>
          <span>.</span>
          <span class="item_number_num_b">{{ banalce.number[1] }}</span>
        </div>
      </div>

      <!-- 余额状态 -->
      <div class="user_balance_item_status">
        <div class="status_sum status_public">
          全部余额:&nbsp;
          <span class="item_number_num_public">{{ banalce.totalBalance }}</span>
        </div>
        <div class="status_lock status_public">
          锁定余额: &nbsp;<span class="item_number_num_public"
            >{{ banalce.lockBalance }}
          </span>
        </div>
        <div class="status user status_public">
          账户状态:&nbsp;&nbsp;<span class="item_number_num_public">{{
            banalce.userStatus
          }}</span>
        </div>
      </div>
    </div>

    <div class="user_balance_lines">
      <div class="user_balance_line_title">历史充值记录</div>
      <div class="user_balance_line"></div>
    </div>

    <!--充值记录 -->
    <div class="user_balance_records">
      <div class="user_balance_records_title">
        <div class="user_balance_records_title_item item_1">时间</div>
        <div class="user_balance_records_title_item item_2">金额</div>
        <div class="user_balance_records_title_item item_3">操作</div>
        <div class="user_balance_records_title_item item_4">备注</div>
      </div>

      <div class="user_balance_records_list" v-for="cont in 20">
        <div class="user_balance_records_list_item item_1">
          {{ banalce.time }}
        </div>
        <div class="user_balance_records_list_item item_2">
          {{ banalce.num }}
        </div>
        <div class="user_balance_records_list_item item_3">
          {{ banalce.operation }}
        </div>
        <div class="user_balance_records_list_item item_4">
          {{ banalce.remarks }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      banalce: {
        number: ["999", "19"],
        totalBalance: "9999.99",
        lockBalance: "0.80",
        userStatus: "正常",

        time: "2020-04-18",
        num: "9996.69",
        operation: "存入",
        remarks: "交易成功!!!",
      },
    };
  },
  created() {
    this.getData();
  },
  methods: {
    getData() {
      var banalce = this.banalce;
      var datas = JSON.stringify(banalce);
      console.log(datas);
      var dataes = JSON.parse(datas);
      console.log(dataes);
    },
  },
};
</script>



<style>
.user_balance_records_list_item {
  float: left;
  text-align: center;
}

.user_balance_records_list {
  height: 40px;
  width: 100%;
  line-height: 40px;
  background-color: rgba(171, 171, 240, 0.318);
  border: 1px solid rgba(174, 157, 157, 0.561);
  /* box-shadow: 0 2px 4px rgb(0 0 0 / 12%), 0 0 6px rgb(0 0 0 / 4%); */
}

/* 历史记录标题 */
.item_1 {
  width: 200px;
}

.item_2 {
  width: 200px;
}

.item_3 {
  width: 100px;
}
.item_4 {
  width: 400px;
}

.user_balance_records_title_item {
  float: left;
  text-align: center;
  color: #474e5d;
  font-size: 14px;
}

.user_balance_records_title {
  height: 40px;
  width: 100%;
  background-color: #e7e7f2;
  line-height: 40px;
  margin-bottom: 5px;
}

.user_balance_records {
  margin-top: 10px;
  width: 100%;
  height: auto;
}

.user_balance_line_title {
  float: right;
  font-size: 12px;
  color: #474e5d;
}
.user_balance_line {
  width: 100%;
  height: 2px;
  background-color: #ced4e0;
}
.user_balance_lines {
  width: 100%;
  height: 20px;
  margin-top: 15px;
}

.item_number_num_m {
  font-size: 40px;
}
.status_public {
  margin-bottom: 10px;
}
.item_number_num_public {
  font-weight: 700;
  font-size: 14px;
}
.user_balance_item_number {
  float: left;
  padding-left: 5%;
  width: 43%;
  height: 100%;
  font-weight: 700;
}
.user_balance_item_status {
  float: right;
  width: 50%;
  height: 100%;
  font-size: 14px;
}

.user_balance_item {
  padding-top: 6%;
  height: 100px;
  color: #474e5d;
}

.user_balance {
  width: 960px;
  height: auto;
  margin: 10px 26px;
  background-color: white;
}
</style>